home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 …ember: Reference Library / Dev.CD Dec 00 RL Disk 1.toast / pc / technical documentation / develop / develop issue 19 / develop issue 19 code / adding gx printing to qd É.sea / Adding GX Printing to QD Apps / Simple Sample GX ƒ / events.c next >
MacBinary  |  1994-08-16  |  11.0 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Aug 16 15:06:39 1994, modified Tue Aug 16 15:06:39 1994, creator Think C, type ASCII, 10295 bytes "events.c" , at 0x28b7 656 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 65 76 65 6e 74 73 | 2e 63 00 00 00 00 00 00 |..events|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 28 37 00 | 00 02 90 aa 76 be bf aa |.....(7.|....v...|
|00000060| 76 be bf 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |v.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 f9 ed 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 0d 0d | 09 65 76 65 6e 74 73 2e |******..|.events.|
|000000d0| 63 0d 09 0d 09 54 68 69 | 73 20 66 69 6c 65 20 63 |c....Thi|s file c|
|000000e0| 6f 6e 74 61 69 6e 73 20 | 74 68 65 20 65 76 65 6e |ontains |the even|
|000000f0| 74 20 68 61 6e 64 6c 69 | 6e 67 20 63 6f 64 65 20 |t handli|ng code |
|00000100| 66 6f 72 20 74 68 65 20 | 51 75 69 63 6b 44 72 61 |for the |QuickDra|
|00000110| 77 20 47 58 0d 09 61 77 | 61 72 65 20 73 61 6d 70 |w GX..aw|are samp|
|00000120| 6c 65 2c 20 22 53 69 6d | 70 6c 65 20 53 61 6d 70 |le, "Sim|ple Samp|
|00000130| 6c 65 20 47 58 2e 22 0d | 09 0d 09 41 64 64 69 74 |le GX.".|...Addit|
|00000140| 69 6f 6e 61 6c 20 69 6e | 66 6f 20 63 61 6e 20 62 |ional in|fo can b|
|00000150| 65 20 66 6f 75 6e 64 20 | 69 6e 20 74 68 65 20 72 |e found |in the r|
|00000160| 65 6c 61 74 65 64 20 64 | 65 76 65 6c 6f 70 20 23 |elated d|evelop #|
|00000170| 31 39 20 61 72 74 69 63 | 6c 65 2c 0d 09 22 41 64 |19 artic|le,.."Ad|
|00000180| 64 69 6e 67 20 51 75 69 | 63 6b 44 72 61 77 20 47 |ding Qui|ckDraw G|
|00000190| 58 20 50 72 69 6e 74 69 | 6e 67 20 74 6f 20 51 75 |X Printi|ng to Qu|
|000001a0| 69 63 6b 44 72 61 77 20 | 41 70 70 6c 69 63 61 74 |ickDraw |Applicat|
|000001b0| 69 6f 6e 73 2e 22 0d 0d | 09 44 61 76 65 20 48 65 |ions."..|.Dave He|
|000001c0| 72 73 65 79 2c 20 41 70 | 70 6c 65 20 44 65 76 65 |rsey, Ap|ple Deve|
|000001d0| 6c 6f 70 65 72 20 54 65 | 63 68 6e 69 63 61 6c 20 |loper Te|chnical |
|000001e0| 53 75 70 70 6f 72 74 2e | 0d 09 0d 09 d1 d1 d1 d1 |Support.|........|
|000001f0| d1 d1 d1 20 45 64 69 74 | 20 54 72 61 69 6c 20 d1 |... Edit| Trail .|
|00000200| d1 d1 d1 d1 d1 d1 0d 09 | 0d 09 62 65 67 61 74 3a |........|..begat:|
|00000210| 09 09 09 09 09 09 09 09 | 09 09 09 31 2f 32 32 2f |........|...1/22/|
|00000220| 39 34 20 20 2d 20 64 6d | 68 0d 09 63 6c 65 61 6e |94 - dm|h..clean|
|00000230| 65 64 20 75 70 20 66 6f | 72 20 32 6e 64 20 64 72 |ed up fo|r 2nd dr|
|00000240| 61 66 74 20 6f 66 20 64 | 65 76 65 6c 6f 70 20 61 |aft of d|evelop a|
|00000250| 72 74 69 63 6c 65 3a 09 | 33 2f 31 30 2f 39 34 20 |rticle:.|3/10/94 |
|00000260| 20 2d 20 64 6d 68 0d 09 | 63 6c 65 61 6e 65 64 20 | - dmh..|cleaned |
|00000270| 75 70 20 66 6f 72 20 66 | 69 6e 61 6c 3a 09 09 09 |up for f|inal:...|
|00000280| 09 09 09 09 34 2f 31 34 | 2f 39 34 20 20 2d 20 64 |....4/14|/94 - d|
|00000290| 6d 68 0d 09 61 64 64 65 | 64 20 4e 65 77 41 45 45 |mh..adde|d NewAEE|
|000002a0| 76 65 6e 74 48 61 6e 64 | 6c 65 72 50 72 6f 63 20 |ventHand|lerProc |
|000002b0| 74 6f 20 62 75 69 6c 64 | 20 70 70 63 20 75 70 70 |to build| ppc upp|
|000002c0| 20 20 20 20 38 2f 31 36 | 2f 39 34 20 20 2d 20 6e | 8/16|/94 - n|
|000002d0| 69 63 6b 0d 09 0d 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |ick...**|********|
|000002e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000002f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000300| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000310| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0d 0d 23 69 |********|***/..#i|
|00000320| 6e 63 6c 75 64 65 20 22 | 53 69 6d 70 6c 65 20 53 |nclude "|Simple S|
|00000330| 61 6d 70 6c 65 2e 68 22 | 0d 0d 0d 2f 2a 2a 2a 2a |ample.h"|.../****|
|00000340| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000370| 2a 2a 2a 2a 2a 2a 2a 2a | 0d 20 20 4d 79 45 76 65 |********|. MyEve|
|00000380| 6e 74 4c 6f 6f 70 20 2d | 20 54 68 69 73 20 72 6f |ntLoop -| This ro|
|00000390| 75 74 69 6e 65 20 28 69 | 6e 20 63 6f 6e 6a 75 6e |utine (i|n conjun|
|000003a0| 63 74 69 6f 6e 20 77 69 | 74 68 20 6d 61 69 6e 29 |ction wi|th main)|
|000003b0| 0d 20 20 6d 61 6b 65 73 | 20 75 70 20 6f 75 72 20 |. makes| up our |
|000003c0| 65 76 65 6e 74 20 6c 6f | 6f 70 2e 0d 20 0d 20 2a |event lo|op.. . *|
|000003d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000003f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000400| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0d 0d 76 |********|****/..v|
|00000410| 6f 69 64 20 4d 79 45 76 | 65 6e 74 4c 6f 6f 70 28 |oid MyEv|entLoop(|
|00000420| 29 0d 7b 0d 09 45 76 65 | 6e 74 52 65 63 6f 72 64 |).{..Eve|ntRecord|
|00000430| 09 09 74 68 65 45 76 65 | 6e 74 3b 0d 0d 09 69 66 |..theEve|nt;...if|
|00000440| 20 28 57 61 69 74 4e 65 | 78 74 45 76 65 6e 74 28 | (WaitNe|xtEvent(|
|00000450| 65 76 65 72 79 45 76 65 | 6e 74 2c 20 26 74 68 65 |everyEve|nt, &the|
|00000460| 45 76 65 6e 74 2c 20 67 | 53 6c 65 65 70 2c 20 6e |Event, g|Sleep, n|
|00000470| 69 6c 29 29 0d 09 09 4d | 79 44 6f 45 76 65 6e 74 |il))...M|yDoEvent|
|00000480| 28 26 74 68 65 45 76 65 | 6e 74 29 3b 0d 7d 0d 0d |(&theEve|nt);.}..|
|00000490| 0d 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |./******|********|
|000004a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000004b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000004c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0d 20 |********|******. |
|000004d0| 20 4d 79 44 6f 45 76 65 | 6e 74 20 2d 20 54 68 69 | MyDoEve|nt - Thi|
|000004e0| 73 20 72 6f 75 74 69 6e | 65 20 68 61 6e 64 6c 65 |s routin|e handle|
|000004f0| 73 20 65 76 65 6e 74 20 | 64 69 73 70 61 74 63 68 |s event |dispatch|
|00000500| 69 6e 67 2e 0d 20 0d 20 | 2a 2a 2a 2a 2a 2a 2a 2a |ing.. . |********|
|00000510| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000520| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000530| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000540| 2a 2a 2a 2a 2a 2f 0d 0d | 76 6f 69 64 20 4d 79 44 |*****/..|void MyD|
|00000550| 6f 45 76 65 6e 74 28 45 | 76 65 6e 74 52 65 63 6f |oEvent(E|ventReco|
|00000560| 72 64 20 2a 74 68 65 45 | 76 65 6e 74 29 0d 7b 0d |rd *theE|vent).{.|
|00000570| 09 63 68 61 72 09 09 09 | 6b 65 79 3b 0d 09 57 69 |.char...|key;..Wi|
|00000580| 6e 64 6f 77 50 74 72 20 | 09 09 77 68 69 63 68 57 |ndowPtr |..whichW|
|00000590| 69 6e 64 6f 77 3b 0d 09 | 4d 79 44 6f 63 75 6d 65 |indow;..|MyDocume|
|000005a0| 6e 74 50 74 72 09 77 69 | 6e 64 6f 77 44 6f 63 3b |ntPtr.wi|ndowDoc;|
|000005b0| 0d 0d 09 73 77 69 74 63 | 68 28 74 68 65 45 76 65 |...switc|h(theEve|
|000005c0| 6e 74 2d 3e 77 68 61 74 | 29 0d 09 7b 09 09 09 09 |nt->what|)..{....|
|000005d0| 09 0d 09 09 63 61 73 65 | 20 75 70 64 61 74 65 45 |....case| updateE|
|000005e0| 76 74 3a 09 09 09 2f 2f | 20 55 70 64 61 74 69 6e |vt:...//| Updatin|
|000005f0| 67 20 61 20 77 69 6e 64 | 6f 77 2e 0d 0d 09 09 09 |g a wind|ow......|
|00000600| 69 66 20 28 28 28 57 69 | 6e 64 6f 77 50 65 65 6b |if (((Wi|ndowPeek|
|00000610| 29 20 74 68 65 45 76 65 | 6e 74 2d 3e 6d 65 73 73 |) theEve|nt->mess|
|00000620| 61 67 65 29 2d 3e 77 69 | 6e 64 6f 77 4b 69 6e 64 |age)->wi|ndowKind|
|00000630| 20 3d 3d 20 75 73 65 72 | 4b 69 6e 64 29 0d 09 09 | == user|Kind)...|
|00000640| 09 09 4d 79 55 70 64 61 | 74 65 57 69 6e 64 6f 77 |..MyUpda|teWindow|
|00000650| 28 28 57 69 6e 64 6f 77 | 50 74 72 29 20 74 68 65 |((Window|Ptr) the|
|00000660| 45 76 65 6e 74 2d 3e 6d | 65 73 73 61 67 65 29 3b |Event->m|essage);|
|00000670| 0d 0d 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 0d 09 |.....bre|ak;.....|
|00000680| 09 63 61 73 65 20 6d 6f | 75 73 65 44 6f 77 6e 3a |.case mo|useDown:|
|00000690| 09 09 09 2f 2f 20 4d 6f | 75 73 65 64 6f 77 6e 20 |...// Mo|usedown |
|000006a0| 69 6e 20 61 20 77 69 6e | 64 6f 77 20 6f 72 20 6d |in a win|dow or m|
|000006b0| 65 6e 75 2e 0d 09 0d 09 | 09 09 73 77 69 74 63 68 |enu.....|..switch|
|000006c0| 20 28 46 69 6e 64 57 69 | 6e 64 6f 77 28 74 68 65 | (FindWi|ndow(the|
|000006d0| 45 76 65 6e 74 2d 3e 77 | 68 65 72 65 2c 20 26 77 |Event->w|here, &w|
|000006e0| 68 69 63 68 57 69 6e 64 | 6f 77 29 29 0d 09 09 09 |hichWind|ow))....|
|000006f0| 7b 0d 09 09 09 09 63 61 | 73 65 20 69 6e 53 79 73 |{.....ca|se inSys|
|00000700| 57 69 6e 64 6f 77 3a 0d | 0d 09 09 09 09 09 53 79 |Window:.|......Sy|
|00000710| 73 74 65 6d 43 6c 69 63 | 6b 28 74 68 65 45 76 65 |stemClic|k(theEve|
|00000720| 6e 74 2c 20 77 68 69 63 | 68 57 69 6e 64 6f 77 29 |nt, whic|hWindow)|
|00000730| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00000740| 09 09 09 09 0d 09 09 09 | 09 63 61 73 65 20 69 6e |........|.case in|
|00000750| 44 72 61 67 3a 0d 0d 09 | 09 09 09 09 69 66 20 28 |Drag:...|....if (|
|00000760| 28 28 57 69 6e 64 6f 77 | 50 65 65 6b 29 20 77 68 |((Window|Peek) wh|
|00000770| 69 63 68 57 69 6e 64 6f | 77 29 2d 3e 77 69 6e 64 |ichWindo|w)->wind|
|00000780| 6f 77 4b 69 6e 64 20 3d | 3d 20 75 73 65 72 4b 69 |owKind =|= userKi|
|00000790| 6e 64 29 0d 09 09 09 09 | 09 7b 0d 09 09 09 09 09 |nd).....|.{......|
|000007a0| 20 20 20 20 44 72 61 67 | 57 69 6e 64 6f 77 28 77 | Drag|Window(w|
|000007b0| 68 69 63 68 57 69 6e 64 | 6f 77 2c 20 74 68 65 45 |hichWind|ow, theE|
|000007c0| 76 65 6e 74 2d 3e 77 68 | 65 72 65 2c 20 26 71 64 |vent->wh|ere, &qd|
|000007d0| 2e 73 63 72 65 65 6e 42 | 69 74 73 2e 62 6f 75 6e |.screenB|its.boun|
|000007e0| 64 73 29 3b 0d 09 09 09 | 09 09 09 4d 79 41 64 6a |ds);....|...MyAdj|
|000007f0| 75 73 74 4d 65 6e 75 73 | 28 29 3b 0d 09 09 09 09 |ustMenus|();.....|
|00000800| 09 7d 0d 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 0d |.}......|break;..|
|00000810| 09 09 09 09 63 61 73 65 | 20 69 6e 47 6f 41 77 61 |....case| inGoAwa|
|00000820| 79 3a 0d 0d 09 09 09 09 | 09 69 66 20 28 28 28 28 |y:......|.if ((((|
|00000830| 57 69 6e 64 6f 77 50 65 | 65 6b 29 20 77 68 69 63 |WindowPe|ek) whic|
|00000840| 68 57 69 6e 64 6f 77 29 | 2d 3e 77 69 6e 64 6f 77 |hWindow)|->window|
|00000850| 4b 69 6e 64 20 3d 3d 20 | 75 73 65 72 4b 69 6e 64 |Kind == |userKind|
|00000860| 29 20 26 26 0d 09 09 09 | 09 09 09 28 54 72 61 63 |) &&....|...(Trac|
|00000870| 6b 47 6f 41 77 61 79 28 | 77 68 69 63 68 57 69 6e |kGoAway(|whichWin|
|00000880| 64 6f 77 2c 20 74 68 65 | 45 76 65 6e 74 2d 3e 77 |dow, the|Event->w|
|00000890| 68 65 72 65 29 29 29 0d | 09 09 09 09 09 7b 0d 09 |here))).|.....{..|
|000008a0| 09 09 09 09 09 4d 79 44 | 69 73 70 6f 73 65 44 6f |.....MyD|isposeDo|
|000008b0| 63 75 6d 65 6e 74 28 4d | 79 47 65 74 44 6f 63 50 |cument(M|yGetDocP|
|000008c0| 74 72 28 77 68 69 63 68 | 57 69 6e 64 6f 77 29 29 |tr(which|Window))|
|000008d0| 3b 0d 09 09 09 09 09 09 | 4d 79 41 64 6a 75 73 74 |;.......|MyAdjust|
|000008e0| 4d 65 6e 75 73 28 29 3b | 0d 09 09 09 09 09 7d 0d |Menus();|......}.|
|000008f0| 09 09 09 09 09 0d 09 09 | 09 09 09 62 72 65 61 6b |........|...break|
|00000900| 3b 0d 09 09 09 09 0d 09 | 09 09 09 63 61 73 65 20 |;.......|...case |
|00000910| 69 6e 43 6f 6e 74 65 6e | 74 3a 0d 0d 09 09 09 09 |inConten|t:......|
|00000920| 09 69 66 20 28 28 28 57 | 69 6e 64 6f 77 50 65 65 |.if (((W|indowPee|
|00000930| 6b 29 20 77 68 69 63 68 | 57 69 6e 64 6f 77 29 2d |k) which|Window)-|
|00000940| 3e 77 69 6e 64 6f 77 4b | 69 6e 64 20 3d 3d 20 75 |>windowK|ind == u|
|00000950| 73 65 72 4b 69 6e 64 29 | 0d 09 09 09 09 09 7b 0d |serKind)|......{.|
|00000960| 09 09 09 09 09 09 53 65 | 6c 65 63 74 57 69 6e 64 |......Se|lectWind|
|00000970| 6f 77 28 77 68 69 63 68 | 57 69 6e 64 6f 77 29 3b |ow(which|Window);|
|00000980| 0d 09 09 09 09 09 09 4d | 79 41 64 6a 75 73 74 4d |.......M|yAdjustM|
|00000990| 65 6e 75 73 28 29 3b 0d | 09 09 09 09 09 7d 0d 09 |enus();.|.....}..|
|000009a0| 09 09 09 09 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |........|..break;|
|000009b0| 0d 0d 09 09 09 09 63 61 | 73 65 20 69 6e 4d 65 6e |......ca|se inMen|
|000009c0| 75 42 61 72 3a 0d 09 09 | 09 09 09 4d 79 44 6f 4d |uBar:...|...MyDoM|
|000009d0| 65 6e 75 43 6f 6d 6d 61 | 6e 64 28 4d 65 6e 75 53 |enuComma|nd(MenuS|
|000009e0| 65 6c 65 63 74 28 74 68 | 65 45 76 65 6e 74 2d 3e |elect(th|eEvent->|
|000009f0| 77 68 65 72 65 29 29 3b | 0d 09 09 09 09 09 4d 79 |where));|......My|
|00000a00| 41 64 6a 75 73 74 4d 65 | 6e 75 73 28 29 3b 0d 09 |AdjustMe|nus();..|
|00000a10| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 7d 0d |....brea|k;....}.|
|00000a20| 0d 09 09 63 61 73 65 20 | 6b 65 79 44 6f 77 6e 3a |...case |keyDown:|
|00000a30| 09 09 09 2f 2f 20 4b 65 | 79 20 70 72 65 73 73 65 |...// Ke|y presse|
|00000a40| 64 2e 0d 09 09 63 61 73 | 65 20 61 75 74 6f 4b 65 |d....cas|e autoKe|
|00000a50| 79 3a 0d 0d 09 09 09 6b | 65 79 20 3d 20 74 68 65 |y:.....k|ey = the|
|00000a60| 45 76 65 6e 74 2d 3e 6d | 65 73 73 61 67 65 20 26 |Event->m|essage &|
|00000a70| 20 63 68 61 72 43 6f 64 | 65 4d 61 73 6b 3b 0d 09 | charCod|eMask;..|
|00000a80| 09 09 69 66 20 28 28 74 | 68 65 45 76 65 6e 74 2d |..if ((t|heEvent-|
|00000a90| 3e 6d 6f 64 69 66 69 65 | 72 73 20 26 20 63 6d 64 |>modifie|rs & cmd|
|00000aa0| 4b 65 79 29 20 26 26 0d | 09 09 09 09 28 74 68 65 |Key) &&.|....(the|
|00000ab0| 45 76 65 6e 74 2d 3e 77 | 68 61 74 20 3d 3d 20 6b |Event->w|hat == k|
|00000ac0| 65 79 44 6f 77 6e 29 29 | 0d 09 09 09 09 7b 0d 09 |eyDown))|.....{..|
|00000ad0| 09 09 09 09 4d 79 44 6f | 4d 65 6e 75 43 6f 6d 6d |....MyDo|MenuComm|
|00000ae0| 61 6e 64 28 4d 65 6e 75 | 4b 65 79 28 6b 65 79 29 |and(Menu|Key(key)|
|00000af0| 29 3b 0d 09 09 09 09 09 | 4d 79 41 64 6a 75 73 74 |);......|MyAdjust|
|00000b00| 4d 65 6e 75 73 28 29 3b | 0d 09 09 09 09 7d 0d 09 |Menus();|.....}..|
|00000b10| 09 09 0d 09 09 09 62 72 | 65 61 6b 3b 0d 0d 09 09 |......br|eak;....|
|00000b20| 63 61 73 65 20 6b 4f 53 | 45 76 65 6e 74 3a 09 09 |case kOS|Event:..|
|00000b30| 09 2f 2f 20 4f 70 65 72 | 61 74 69 6e 67 20 73 79 |.// Oper|ating sy|
|00000b40| 73 74 65 6d 20 65 76 65 | 6e 74 2e 0d 0d 09 09 09 |stem eve|nt......|
|00000b50| 73 77 69 74 63 68 20 28 | 28 75 6e 73 69 67 6e 65 |switch (|(unsigne|
|00000b60| 64 20 6c 6f 6e 67 29 20 | 74 68 65 45 76 65 6e 74 |d long) |theEvent|
|00000b70| 2d 3e 6d 65 73 73 61 67 | 65 20 3e 3e 20 32 34 29 |->messag|e >> 24)|
|00000b80| 0d 09 09 09 7b 0d 09 09 | 09 20 09 63 61 73 65 20 |....{...|. .case |
|00000b90| 6b 53 75 73 70 65 6e 64 | 52 65 73 75 6d 65 4d 65 |kSuspend|ResumeMe|
|00000ba0| 73 73 61 67 65 3a 09 09 | 09 09 09 09 09 2f 2f 20 |ssage:..|.....// |
|00000bb0| 53 75 73 70 65 6e 64 20 | 65 76 65 6e 74 3a 0d 09 |Suspend |event:..|
|00000bc0| 09 09 09 09 69 66 20 28 | 28 74 68 65 45 76 65 6e |....if (|(theEven|
|00000bd0| 74 2d 3e 6d 65 73 73 61 | 67 65 20 26 20 6b 52 65 |t->messa|ge & kRe|
|00000be0| 73 75 6d 65 4d 61 73 6b | 29 20 3d 3d 20 30 29 0d |sumeMask|) == 0).|
|00000bf0| 09 09 09 09 09 09 67 53 | 6c 65 65 70 20 3d 20 38 |......gS|leep = 8|
|00000c00| 30 3b 0d 09 09 09 09 09 | 65 6c 73 65 09 09 09 09 |0;......|else....|
|00000c10| 09 09 09 09 09 09 09 2f | 2f 20 52 65 73 75 6d 65 |......./|/ Resume|
|00000c20| 20 65 76 65 6e 74 3a 0d | 09 09 09 09 09 7b 0d 09 | event:.|.....{..|
|00000c30| 09 09 09 09 09 67 53 6c | 65 65 70 20 3d 20 30 3b |.....gSl|eep = 0;|
|00000c40| 0d 09 09 09 09 09 09 53 | 65 74 43 75 72 73 6f 72 |.......S|etCursor|
|00000c50| 28 26 71 64 2e 61 72 72 | 6f 77 29 3b 0d 0d 2f 2a |(&qd.arr|ow);../*|
|00000c60| 0d 09 49 66 20 77 65 27 | 72 65 20 75 73 69 6e 67 |..If we'|re using|
|00000c70| 20 51 75 69 63 6b 44 72 | 61 77 20 47 58 2c 20 77 | QuickDr|aw GX, w|
|00000c80| 65 20 6e 65 65 64 20 74 | 6f 20 63 61 6c 6c 20 47 |e need t|o call G|
|00000c90| 58 55 70 64 61 74 65 4a | 6f 62 20 6f 6e 20 61 6c |XUpdateJ|ob on al|
|00000ca0| 6c 20 6f 66 0d 09 6f 75 | 72 20 67 78 4a 6f 62 20 |l of..ou|r gxJob |
|00000cb0| 6f 62 6a 65 63 74 73 20 | 77 68 65 6e 65 76 65 72 |objects |whenever|
|00000cc0| 20 77 65 20 72 65 63 65 | 69 76 65 20 61 20 72 65 | we rece|ive a re|
|00000cd0| 73 75 6d 65 20 65 76 65 | 6e 74 2e 20 20 4f 74 68 |sume eve|nt. Oth|
|00000ce0| 65 72 77 69 73 65 2c 0d | 09 6e 65 77 20 75 73 65 |erwise,.|.new use|
|00000cf0| 72 20 73 65 74 74 69 6e | 67 73 20 6d 69 67 68 74 |r settin|gs might|
|00000d00| 20 6e 6f 74 20 62 65 20 | 72 65 66 6c 65 63 74 65 | not be |reflecte|
|00000d10| 64 20 69 6e 20 74 68 65 | 73 65 20 6a 6f 62 73 2e |d in the|se jobs.|
|00000d20| 0d 2a 2f 0d 09 09 09 09 | 09 09 69 66 20 28 67 47 |.*/.....|..if (gG|
|00000d30| 58 49 73 50 72 65 73 65 | 6e 74 29 0d 09 09 09 09 |XIsPrese|nt).....|
|00000d40| 09 09 7b 0d 09 09 09 09 | 09 09 09 77 68 69 63 68 |..{.....|...which|
|00000d50| 57 69 6e 64 6f 77 20 3d | 20 46 72 6f 6e 74 57 69 |Window =| FrontWi|
|00000d60| 6e 64 6f 77 28 29 3b 0d | 09 09 09 09 09 09 0d 09 |ndow();.|........|
|00000d70| 09 09 09 09 09 09 77 68 | 69 6c 65 20 28 77 68 69 |......wh|ile (whi|
|00000d80| 63 68 57 69 6e 64 6f 77 | 20 21 3d 20 6e 69 6c 29 |chWindow| != nil)|
|00000d90| 0d 09 09 09 09 09 09 09 | 7b 0d 09 09 09 09 09 09 |........|{.......|
|00000da0| 09 09 69 66 20 28 28 28 | 57 69 6e 64 6f 77 50 65 |..if (((|WindowPe|
|00000db0| 65 6b 29 20 77 68 69 63 | 68 57 69 6e 64 6f 77 29 |ek) whic|hWindow)|
|00000dc0| 2d 3e 77 69 6e 64 6f 77 | 4b 69 6e 64 20 3d 3d 20 |->window|Kind == |
|00000dd0| 75 73 65 72 4b 69 6e 64 | 29 0d 09 09 09 09 09 09 |userKind|).......|
|00000de0| 09 09 7b 0d 09 09 09 09 | 09 09 09 09 09 77 69 6e |..{.....|.....win|
|00000df0| 64 6f 77 44 6f 63 20 3d | 20 4d 79 47 65 74 44 6f |dowDoc =| MyGetDo|
|00000e00| 63 50 74 72 28 77 68 69 | 63 68 57 69 6e 64 6f 77 |cPtr(whi|chWindow|
|00000e10| 29 3b 0d 09 09 09 09 09 | 09 09 09 09 47 58 55 70 |);......|....GXUp|
|00000e20| 64 61 74 65 4a 6f 62 28 | 77 69 6e 64 6f 77 44 6f |dateJob(|windowDo|
|00000e30| 63 2d 3e 64 6f 63 75 6d | 65 6e 74 4a 6f 62 29 3b |c->docum|entJob);|
|00000e40| 0d 09 09 09 09 09 09 09 | 09 7d 0d 09 09 09 09 09 |........|.}......|
|00000e50| 09 09 09 0d 09 09 09 09 | 09 09 09 09 77 68 69 63 |........|....whic|
|00000e60| 68 57 69 6e 64 6f 77 20 | 3d 20 28 57 69 6e 64 6f |hWindow |= (Windo|
|00000e70| 77 50 74 72 29 20 28 28 | 57 69 6e 64 6f 77 50 65 |wPtr) ((|WindowPe|
|00000e80| 65 6b 29 20 77 68 69 63 | 68 57 69 6e 64 6f 77 29 |ek) whic|hWindow)|
|00000e90| 2d 3e 6e 65 78 74 57 69 | 6e 64 6f 77 3b 0d 09 09 |->nextWi|ndow;...|
|00000ea0| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 09 7d 0d 09 |.....}..|.....}..|
|00000eb0| 09 09 09 09 7d 0d 0d 09 | 09 09 09 62 72 65 61 6b |....}...|...break|
|00000ec0| 3b 0d 09 09 09 7d 0d 0d | 09 09 09 62 72 65 61 6b |;....}..|...break|
|00000ed0| 3b 0d 09 09 09 09 0d 09 | 09 63 61 73 65 20 6b 48 |;.......|.case kH|
|00000ee0| 69 67 68 4c 65 76 65 6c | 45 76 65 6e 74 3a 09 2f |ighLevel|Event:./|
|00000ef0| 2f 20 41 70 70 6c 65 45 | 76 65 6e 74 2e 0d 0d 09 |/ AppleE|vent....|
|00000f00| 09 09 41 45 50 72 6f 63 | 65 73 73 41 70 70 6c 65 |..AEProc|essApple|
|00000f10| 45 76 65 6e 74 28 74 68 | 65 45 76 65 6e 74 29 3b |Event(th|eEvent);|
|00000f20| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 7d 0d 7d 0d |....brea|k;..}.}.|
|00000f30| 0d 0d 2f 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |../*****|********|
|00000f40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 0d |********|*******.|
|00000f70| 20 20 4d 79 44 6f 41 45 | 49 6e 73 74 61 6c 6c 61 | MyDoAE|Installa|
|00000f80| 74 69 6f 6e 20 2d 20 54 | 68 69 73 20 72 6f 75 74 |tion - T|his rout|
|00000f90| 69 6e 65 20 69 6e 73 74 | 61 6c 6c 73 20 6f 75 72 |ine inst|alls our|
|00000fa0| 20 63 6f 72 65 0d 20 20 | 41 70 70 6c 65 45 76 65 | core. |AppleEve|
|00000fb0| 6e 74 20 68 61 6e 64 6c | 65 72 73 2e 0d 0d 2a 2a |nt handl|ers...**|
|00000fc0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000fd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000fe0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000ff0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0d 0d 76 6f |********|***/..vo|
|00001000| 69 64 20 4d 79 44 6f 41 | 45 49 6e 73 74 61 6c 6c |id MyDoA|EInstall|
|00001010| 61 74 69 6f 6e 28 29 0d | 7b 0d 09 41 45 49 6e 73 |ation().|{..AEIns|
|00001020| 74 61 6c 6c 45 76 65 6e | 74 48 61 6e 64 6c 65 72 |tallEven|tHandler|
|00001030| 28 6b 43 6f 72 65 45 76 | 65 6e 74 43 6c 61 73 73 |(kCoreEv|entClass|
|00001040| 2c 0d 09 09 09 09 09 09 | 20 20 6b 41 45 4f 70 65 |,.......| kAEOpe|
|00001050| 6e 41 70 70 6c 69 63 61 | 74 69 6f 6e 2c 0d 09 09 |nApplica|tion,...|
|00001060| 09 09 09 09 20 20 4e 65 | 77 41 45 45 76 65 6e 74 |.... Ne|wAEEvent|
|00001070| 48 61 6e 64 6c 65 72 50 | 72 6f 63 28 4d 79 48 61 |HandlerP|roc(MyHa|
|00001080| 6e 64 6c 65 4f 41 50 50 | 29 2c 0d 09 09 09 09 09 |ndleOAPP|),......|
|00001090| 09 20 20 30 2c 20 66 61 | 6c 73 65 29 3b 0d 0d 09 |. 0, fa|lse);...|
|000010a0| 41 45 49 6e 73 74 61 6c | 6c 45 76 65 6e 74 48 61 |AEInstal|lEventHa|
|000010b0| 6e 64 6c 65 72 28 6b 43 | 6f 72 65 45 76 65 6e 74 |ndler(kC|oreEvent|
|000010c0| 43 6c 61 73 73 2c 0d 09 | 09 09 09 09 09 20 20 6b |Class,..|..... k|
|000010d0| 41 45 51 75 69 74 41 70 | 70 6c 69 63 61 74 69 6f |AEQuitAp|plicatio|
|000010e0| 6e 2c 0d 09 09 09 09 09 | 09 20 20 4e 65 77 41 45 |n,......|. NewAE|
|000010f0| 45 76 65 6e 74 48 61 6e | 64 6c 65 72 50 72 6f 63 |EventHan|dlerProc|
|00001100| 28 4d 79 48 61 6e 64 6c | 65 51 55 49 54 29 2c 0d |(MyHandl|eQUIT),.|
|00001110| 09 09 09 09 09 09 20 20 | 30 2c 20 66 61 6c 73 65 |...... |0, false|
|00001120| 29 3b 0d 0d 09 41 45 49 | 6e 73 74 61 6c 6c 45 76 |);...AEI|nstallEv|
|00001130| 65 6e 74 48 61 6e 64 6c | 65 72 28 6b 43 6f 72 65 |entHandl|er(kCore|
|00001140| 45 76 65 6e 74 43 6c 61 | 73 73 2c 0d 09 09 09 09 |EventCla|ss,.....|
|00001150| 09 09 20 20 6b 41 45 4f | 70 65 6e 44 6f 63 75 6d |.. kAEO|penDocum|
|00001160| 65 6e 74 73 2c 0d 09 09 | 09 09 09 09 20 20 4e 65 |ents,...|.... Ne|
|00001170| 77 41 45 45 76 65 6e 74 | 48 61 6e 64 6c 65 72 50 |wAEEvent|HandlerP|
|00001180| 72 6f 63 28 4d 79 48 61 | 6e 64 6c 65 4f 44 4f 43 |roc(MyHa|ndleODOC|
|00001190| 29 2c 0d 09 09 09 09 09 | 09 20 20 30 2c 20 66 61 |),......|. 0, fa|
|000011a0| 6c 73 65 29 3b 0d 0d 09 | 41 45 49 6e 73 74 61 6c |lse);...|AEInstal|
|000011b0| 6c 45 76 65 6e 74 48 61 | 6e 64 6c 65 72 28 6b 43 |lEventHa|ndler(kC|
|000011c0| 6f 72 65 45 76 65 6e 74 | 43 6c 61 73 73 2c 0d 09 |oreEvent|Class,..|
|000011d0| 09 09 09 09 09 20 20 6b | 41 45 50 72 69 6e 74 44 |..... k|AEPrintD|
|000011e0| 6f 63 75 6d 65 6e 74 73 | 2c 0d 09 09 09 09 09 09 |ocuments|,.......|
|000011f0| 20 20 4e 65 77 41 45 45 | 76 65 6e 74 48 61 6e 64 | NewAEE|ventHand|
|00001200| 6c 65 72 50 72 6f 63 28 | 4d 79 48 61 6e 64 6c 65 |lerProc(|MyHandle|
|00001210| 50 44 4f 43 29 2c 0d 09 | 09 09 09 09 09 20 20 30 |PDOC),..|..... 0|
|00001220| 2c 20 66 61 6c 73 65 29 | 3b 0d 7d 0d 0d 0d 2f 2a |, false)|;.}.../*|
|00001230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001250| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001260| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0d 20 20 4d 79 |********|***. My|
|00001270| 48 61 6e 64 6c 65 4f 41 | 50 50 20 2d 20 54 68 69 |HandleOA|PP - Thi|
|00001280| 73 20 69 73 20 74 68 65 | 20 22 6f 70 65 6e 20 61 |s is the| "open a|
|00001290| 70 70 6c 69 63 61 74 69 | 6f 6e 22 20 41 70 70 6c |pplicati|on" Appl|
|000012a0| 65 45 76 65 6e 74 0d 20 | 20 68 61 6e 64 6c 65 72 |eEvent. | handler|
|000012b0| 2e 20 20 57 65 20 63 68 | 65 63 6b 20 6f 75 74 20 |. We ch|eck out |
|000012c0| 74 68 65 20 6d 65 73 73 | 61 67 65 2c 20 61 6e 64 |the mess|age, and|
|000012d0| 20 73 65 74 20 6f 75 72 | 20 22 73 68 6f 75 6c 64 | set our| "should|
|000012e0| 20 77 65 0d 20 20 71 75 | 69 74 20 61 66 74 65 72 | we. qu|it after|
|000012f0| 20 68 61 6e 64 6c 69 6e | 67 20 61 20 27 70 64 6f | handlin|g a 'pdo|
|00001300| 63 27 22 20 66 6c 61 67 | 20 74 6f 20 66 61 6c 73 |c'" flag| to fals|
|00001310| 65 2e 20 20 49 66 20 77 | 65 20 67 6f 74 20 61 6e |e. If w|e got an|
|00001320| 0d 20 20 27 6f 61 70 70 | 27 2c 20 77 65 20 77 65 |. 'oapp|', we we|
|00001330| 72 65 6e 27 74 20 6c 61 | 75 6e 63 68 65 64 20 76 |ren't la|unched v|
|00001340| 69 61 20 27 70 64 6f 63 | 27 2e 0d 0d 2a 2a 2a 2a |ia 'pdoc|'...****|
|00001350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001370| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001380| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2f 0d 0d 70 61 73 63 |********|*/..pasc|
|00001390| 61 6c 20 4f 53 45 72 72 | 20 4d 79 48 61 6e 64 6c |al OSErr| MyHandl|
|000013a0| 65 4f 41 50 50 28 41 70 | 70 6c 65 45 76 65 6e 74 |eOAPP(Ap|pleEvent|
|000013b0| 20 2a 74 68 65 41 70 70 | 6c 65 45 76 65 6e 74 2c | *theApp|leEvent,|
|000013c0| 20 41 70 70 6c 65 45 76 | 65 6e 74 20 2a 72 65 70 | AppleEv|ent *rep|
|000013d0| 6c 79 2c 20 6c 6f 6e 67 | 20 6d 79 52 65 66 43 6f |ly, long| myRefCo|
|000013e0| 6e 29 0d 7b 0d 23 70 72 | 61 67 6d 61 20 75 6e 75 |n).{.#pr|agma unu|
|000013f0| 73 65 64 20 28 72 65 70 | 6c 79 2c 20 6d 79 52 65 |sed (rep|ly, myRe|
|00001400| 66 43 6f 6e 29 0d 0d 09 | 67 51 75 69 74 41 66 74 |fCon)...|gQuitAft|
|00001410| 65 72 50 72 69 6e 74 69 | 6e 67 20 3d 20 66 61 6c |erPrinti|ng = fal|
|00001420| 73 65 3b 0d 09 72 65 74 | 75 72 6e 20 4d 79 43 68 |se;..ret|urn MyCh|
|00001430| 65 63 6b 41 45 50 61 72 | 61 6d 73 28 74 68 65 41 |eckAEPar|ams(theA|
|00001440| 70 70 6c 65 45 76 65 6e | 74 29 3b 0d 7d 0d 0d 0d |ppleEven|t);.}...|
|00001450| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00001460| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001470| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001480| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 20 20 |********|*****. |
|00001490| 4d 79 48 61 6e 64 6c 65 | 51 55 49 54 20 2d 20 54 |MyHandle|QUIT - T|
|000014a0| 68 69 73 20 69 73 20 74 | 68 65 20 22 71 75 69 74 |his is t|he "quit|
|000014b0| 22 20 41 70 70 6c 65 45 | 76 65 6e 74 20 68 61 6e |" AppleE|vent han|
|000014c0| 64 6c 65 72 2e 20 20 53 | 65 74 0d 20 20 74 68 65 |dler. S|et. the|
|000014d0| 20 67 51 75 69 74 74 69 | 6e 67 20 66 6c 61 67 20 | gQuitti|ng flag |
|000014e0| 61 6e 64 20 74 68 65 20 | 65 76 65 6e 74 20 6c 6f |and the |event lo|
|000014f0| 6f 70 20 77 69 6c 6c 20 | 64 6f 20 74 68 65 20 72 |op will |do the r|
|00001500| 65 73 74 2e 0d 0d 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |est...**|********|
|00001510| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001520| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001530| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001540| 2a 2a 2a 2f 0d 0d 70 61 | 73 63 61 6c 20 4f 53 45 |***/..pa|scal OSE|
|00001550| 72 72 20 4d 79 48 61 6e | 64 6c 65 51 55 49 54 28 |rr MyHan|dleQUIT(|
|00001560| 41 70 70 6c 65 45 76 65 | 6e 74 20 2a 74 68 65 41 |AppleEve|nt *theA|
|00001570| 70 70 6c 65 45 76 65 6e | 74 2c 20 41 70 70 6c 65 |ppleEven|t, Apple|
|00001580| 45 76 65 6e 74 20 2a 72 | 65 70 6c 79 2c 20 6c 6f |Event *r|eply, lo|
|00001590| 6e 67 20 6d 79 52 65 66 | 43 6f 6e 29 0d 7b 0d 23 |ng myRef|Con).{.#|
|000015a0| 70 72 61 67 6d 61 20 75 | 6e 75 73 65 64 20 28 72 |pragma u|nused (r|
|000015b0| 65 70 6c 79 2c 20 6d 79 | 52 65 66 43 6f 6e 29 0d |eply, my|RefCon).|
|000015c0| 0d 09 67 51 75 69 74 74 | 69 6e 67 20 3d 20 74 72 |..gQuitt|ing = tr|
|000015d0| 75 65 3b 0d 09 72 65 74 | 75 72 6e 20 4d 79 43 68 |ue;..ret|urn MyCh|
|000015e0| 65 63 6b 41 45 50 61 72 | 61 6d 73 28 74 68 65 41 |eckAEPar|ams(theA|
|000015f0| 70 70 6c 65 45 76 65 6e | 74 29 3b 0d 7d 0d 0d 0d |ppleEven|t);.}...|
|00001600| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00001610| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001620| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001630| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 20 20 |********|*****. |
|00001640| 4d 79 48 61 6e 64 6c 65 | 4f 44 4f 43 20 2d 20 54 |MyHandle|ODOC - T|
|00001650| 68 69 73 20 69 73 20 74 | 68 65 20 22 6f 70 65 6e |his is t|he "open|
|00001660| 20 64 6f 63 75 6d 65 6e | 74 22 20 41 70 70 6c 65 | documen|t" Apple|
|00001670| 45 76 65 6e 74 0d 20 20 | 68 61 6e 64 6c 65 72 2c |Event. |handler,|
|00001680| 20 73 6f 20 6f 70 65 6e | 20 73 6f 6d 65 20 64 6f | so open| some do|
|00001690| 63 75 6d 65 6e 74 73 2e | 0d 0d 2a 2a 2a 2a 2a 2a |cuments.|..******|
|000016a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000016b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000016c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000016d0| 2a 2a 2a 2a 2a 2a 2a 2f | 0d 0d 70 61 73 63 61 6c |*******/|..pascal|
|000016e0| 20 4f 53 45 72 72 20 4d | 79 48 61 6e 64 6c 65 4f | OSErr M|yHandleO|
|000016f0| 44 4f 43 28 41 70 70 6c | 65 45 76 65 6e 74 20 2a |DOC(Appl|eEvent *|
|00001700| 74 68 65 41 70 70 6c 65 | 45 76 65 6e 74 2c 20 41 |theApple|Event, A|
|00001710| 70 70 6c 65 45 76 65 6e | 74 20 2a 72 65 70 6c 79 |ppleEven|t *reply|
|00001720| 2c 20 6c 6f 6e 67 20 6d | 79 52 65 66 43 6f 6e 29 |, long m|yRefCon)|
|00001730| 0d 7b 0d 09 4f 53 45 72 | 72 09 09 09 65 72 72 3b |.{..OSEr|r...err;|
|00001740| 0d 09 41 45 44 65 73 63 | 4c 69 73 74 09 09 64 6f |..AEDesc|List..do|
|00001750| 63 4c 69 73 74 3b 0d 09 | 46 53 53 70 65 63 09 09 |cList;..|FSSpec..|
|00001760| 09 6d 79 46 53 53 3b 0d | 09 41 45 4b 65 79 77 6f |.myFSS;.|.AEKeywo|
|00001770| 72 64 09 09 74 68 65 4b | 65 79 77 6f 72 64 3b 0d |rd..theK|eyword;.|
|00001780| 09 44 65 73 63 54 79 70 | 65 09 09 74 79 70 65 43 |.DescTyp|e..typeC|
|00001790| 6f 64 65 3b 0d 09 6c 6f | 6e 67 09 09 09 64 6f 63 |ode;..lo|ng...doc|
|000017a0| 2c 20 69 74 65 6d 73 49 | 6e 4c 69 73 74 3b 0d 09 |, itemsI|nList;..|
|000017b0| 53 69 7a 65 09 09 09 61 | 63 74 75 61 6c 53 69 7a |Size...a|ctualSiz|
|000017c0| 65 3b 0d 09 4d 79 44 6f | 63 75 6d 65 6e 74 50 74 |e;..MyDo|cumentPt|
|000017d0| 72 09 6e 65 77 44 6f 63 | 75 6d 65 6e 74 3b 0d 0d |r.newDoc|ument;..|
|000017e0| 23 70 72 61 67 6d 61 20 | 75 6e 75 73 65 64 20 28 |#pragma |unused (|
|000017f0| 72 65 70 6c 79 2c 20 6d | 79 52 65 66 43 6f 6e 29 |reply, m|yRefCon)|
|00001800| 0d 0d 09 67 51 75 69 74 | 41 66 74 65 72 50 72 69 |...gQuit|AfterPri|
|00001810| 6e 74 69 6e 67 20 3d 20 | 66 61 6c 73 65 3b 0d 0d |nting = |false;..|
|00001820| 2f 2f 20 47 65 74 20 74 | 68 65 20 65 76 65 6e 74 |// Get t|he event|
|00001830| 27 73 20 64 6f 63 75 6d | 65 6e 74 20 6c 69 73 74 |'s docum|ent list|
|00001840| 2e 0d 0d 09 65 72 72 20 | 3d 20 41 45 47 65 74 50 |....err |= AEGetP|
|00001850| 61 72 61 6d 44 65 73 63 | 28 74 68 65 41 70 70 6c |aramDesc|(theAppl|
|00001860| 65 45 76 65 6e 74 2c 20 | 6b 65 79 44 69 72 65 63 |eEvent, |keyDirec|
|00001870| 74 4f 62 6a 65 63 74 2c | 20 74 79 70 65 41 45 4c |tObject,| typeAEL|
|00001880| 69 73 74 2c 20 26 64 6f | 63 4c 69 73 74 29 3b 0d |ist, &do|cList);.|
|00001890| 09 6e 72 65 71 75 69 72 | 65 28 65 72 72 2c 20 41 |.nrequir|e(err, A|
|000018a0| 45 45 72 72 6f 72 29 3b | 0d 0d 09 65 72 72 20 3d |EError);|...err =|
|000018b0| 20 4d 79 43 68 65 63 6b | 41 45 50 61 72 61 6d 73 | MyCheck|AEParams|
|000018c0| 28 74 68 65 41 70 70 6c | 65 45 76 65 6e 74 29 3b |(theAppl|eEvent);|
|000018d0| 0d 09 6e 72 65 71 75 69 | 72 65 28 65 72 72 2c 20 |..nrequi|re(err, |
|000018e0| 43 68 65 63 6b 41 45 50 | 61 72 61 6d 73 46 61 69 |CheckAEP|aramsFai|
|000018f0| 6c 65 64 29 3b 0d 09 0d | 0d 2f 2f 20 4f 70 65 6e |led);...|.// Open|
|00001900| 20 61 6c 6c 20 65 6e 74 | 72 69 65 73 20 69 6e 20 | all ent|ries in |
|00001910| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 6c 69 73 |the docu|ment lis|
|00001920| 74 2e 0d 0d 09 65 72 72 | 20 3d 20 41 45 43 6f 75 |t....err| = AECou|
|00001930| 6e 74 49 74 65 6d 73 28 | 26 64 6f 63 4c 69 73 74 |ntItems(|&docList|
|00001940| 2c 20 26 69 74 65 6d 73 | 49 6e 4c 69 73 74 29 3b |, &items|InList);|
|00001950| 0d 09 6e 72 65 71 75 69 | 72 65 28 65 72 72 2c 20 |..nrequi|re(err, |
|00001960| 41 45 43 6f 75 6e 74 49 | 74 65 6d 73 46 61 69 6c |AECountI|temsFail|
|00001970| 65 64 29 3b 0d 0d 09 66 | 6f 72 20 28 64 6f 63 20 |ed);...f|or (doc |
|00001980| 3d 20 31 3b 20 28 21 65 | 72 72 29 20 26 26 20 28 |= 1; (!e|rr) && (|
|00001990| 64 6f 63 20 3c 3d 20 69 | 74 65 6d 73 49 6e 4c 69 |doc <= i|temsInLi|
|000019a0| 73 74 29 3b 20 64 6f 63 | 2b 2b 29 0d 09 7b 0d 09 |st); doc|++)..{..|
|000019b0| 09 65 72 72 20 3d 20 41 | 45 47 65 74 4e 74 68 50 |.err = A|EGetNthP|
|000019c0| 74 72 28 26 64 6f 63 4c | 69 73 74 2c 20 64 6f 63 |tr(&docL|ist, doc|
|000019d0| 2c 20 74 79 70 65 46 53 | 53 2c 20 26 74 68 65 4b |, typeFS|S, &theK|
|000019e0| 65 79 77 6f 72 64 2c 20 | 26 74 79 70 65 43 6f 64 |eyword, |&typeCod|
|000019f0| 65 2c 0d 09 09 09 09 09 | 09 20 20 28 50 74 72 29 |e,......|. (Ptr)|
|00001a00| 20 26 6d 79 46 53 53 2c | 20 73 69 7a 65 6f 66 28 | &myFSS,| sizeof(|
|00001a10| 46 53 53 70 65 63 29 2c | 20 26 61 63 74 75 61 6c |FSSpec),| &actual|
|00001a20| 53 69 7a 65 29 3b 0d 09 | 0d 09 09 6e 72 65 71 75 |Size);..|...nrequ|
|00001a30| 69 72 65 28 65 72 72 2c | 20 41 45 45 6e 74 72 79 |ire(err,| AEEntry|
|00001a40| 45 72 72 6f 72 29 3b 0d | 0d 09 09 65 72 72 20 3d |Error);.|...err =|
|00001a50| 20 4d 79 43 72 65 61 74 | 65 44 6f 63 75 6d 65 6e | MyCreat|eDocumen|
|00001a60| 74 28 6b 44 65 66 61 75 | 6c 74 54 69 74 6c 65 2c |t(kDefau|ltTitle,|
|00001a70| 20 26 6e 65 77 44 6f 63 | 75 6d 65 6e 74 29 3b 0d | &newDoc|ument);.|
|00001a80| 09 09 6e 72 65 71 75 69 | 72 65 28 65 72 72 2c 20 |..nrequi|re(err, |
|00001a90| 43 72 65 61 74 65 44 6f | 63 46 61 69 6c 65 64 29 |CreateDo|cFailed)|
|00001aa0| 3b 0d 0d 09 09 65 72 72 | 20 3d 20 4d 79 46 53 4c |;....err| = MyFSL|
|00001ab0| 6f 61 64 44 6f 63 75 6d | 65 6e 74 28 6e 65 77 44 |oadDocum|ent(newD|
|00001ac0| 6f 63 75 6d 65 6e 74 2c | 20 26 6d 79 46 53 53 2c |ocument,| &myFSS,|
|00001ad0| 20 66 61 6c 73 65 29 3b | 0d 0d 09 09 69 66 20 28 | false);|....if (|
|00001ae0| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 29 0d 09 09 |err == n|oErr)...|
|00001af0| 7b 0d 09 09 09 53 68 6f | 77 57 69 6e 64 6f 77 28 |{....Sho|wWindow(|
|00001b00| 6e 65 77 44 6f 63 75 6d | 65 6e 74 2d 3e 64 6f 63 |newDocum|ent->doc|
|00001b10| 75 6d 65 6e 74 57 69 6e | 64 6f 77 29 3b 0d 09 09 |umentWin|dow);...|
|00001b20| 09 53 65 6c 65 63 74 57 | 69 6e 64 6f 77 28 6e 65 |.SelectW|indow(ne|
|00001b30| 77 44 6f 63 75 6d 65 6e | 74 2d 3e 64 6f 63 75 6d |wDocumen|t->docum|
|00001b40| 65 6e 74 57 69 6e 64 6f | 77 29 3b 0d 09 09 7d 0d |entWindo|w);...}.|
|00001b50| 09 09 65 6c 73 65 0d 09 | 09 09 4d 79 44 69 73 70 |..else..|..MyDisp|
|00001b60| 6f 73 65 44 6f 63 75 6d | 65 6e 74 28 6e 65 77 44 |oseDocum|ent(newD|
|00001b70| 6f 63 75 6d 65 6e 74 29 | 3b 0d 09 7d 0d 0d 43 72 |ocument)|;..}..Cr|
|00001b80| 65 61 74 65 44 6f 63 46 | 61 69 6c 65 64 3a 0d 41 |eateDocF|ailed:.A|
|00001b90| 45 45 6e 74 72 79 45 72 | 72 6f 72 3a 0d 41 45 43 |EEntryEr|ror:.AEC|
|00001ba0| 6f 75 6e 74 49 74 65 6d | 73 46 61 69 6c 65 64 3a |ountItem|sFailed:|
|00001bb0| 0d 43 68 65 63 6b 41 45 | 50 61 72 61 6d 73 46 61 |.CheckAE|ParamsFa|
|00001bc0| 69 6c 65 64 3a 0d 09 41 | 45 44 69 73 70 6f 73 65 |iled:..A|EDispose|
|00001bd0| 44 65 73 63 28 26 64 6f | 63 4c 69 73 74 29 3b 0d |Desc(&do|cList);.|
|00001be0| 09 4d 79 41 64 6a 75 73 | 74 4d 65 6e 75 73 28 29 |.MyAdjus|tMenus()|
|00001bf0| 3b 0d 0d 41 45 45 72 72 | 6f 72 3a 0d 09 72 65 74 |;..AEErr|or:..ret|
|00001c00| 75 72 6e 20 65 72 72 3b | 0d 7d 0d 0d 0d 2f 2a 2a |urn err;|.}.../**|
|00001c10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0d 20 20 4d 79 48 |********|**. MyH|
|00001c50| 61 6e 64 6c 65 50 44 4f | 43 20 2d 20 54 68 69 73 |andlePDO|C - This|
|00001c60| 20 69 73 20 74 68 65 20 | 22 70 72 69 6e 74 20 64 | is the |"print d|
|00001c70| 6f 63 75 6d 65 6e 74 22 | 20 41 70 70 6c 65 45 76 |ocument"| AppleEv|
|00001c80| 65 6e 74 0d 20 20 68 61 | 6e 64 6c 65 72 2c 20 73 |ent. ha|ndler, s|
|00001c90| 6f 20 70 72 69 6e 74 20 | 73 6f 6d 65 20 64 6f 63 |o print |some doc|
|00001ca0| 75 6d 65 6e 74 73 2e 0d | 0d 2a 2a 2a 2a 2a 2a 2a |uments..|.*******|
|00001cb0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001cc0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001cd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001ce0| 2a 2a 2a 2a 2a 2a 2f 0d | 0d 70 61 73 63 61 6c 20 |******/.|.pascal |
|00001cf0| 4f 53 45 72 72 20 4d 79 | 48 61 6e 64 6c 65 50 44 |OSErr My|HandlePD|
|00001d00| 4f 43 28 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 74 |OC(Apple|Event *t|
|00001d10| 68 65 41 70 70 6c 65 45 | 76 65 6e 74 2c 20 41 70 |heAppleE|vent, Ap|
|00001d20| 70 6c 65 45 76 65 6e 74 | 20 2a 72 65 70 6c 79 2c |pleEvent| *reply,|
|00001d30| 20 6c 6f 6e 67 20 6d 79 | 52 65 66 43 6f 6e 29 0d | long my|RefCon).|
|00001d40| 7b 0d 09 4f 53 45 72 72 | 09 09 09 65 72 72 3b 0d |{..OSErr|...err;.|
|00001d50| 09 41 45 44 65 73 63 4c | 69 73 74 09 09 64 6f 63 |.AEDescL|ist..doc|
|00001d60| 4c 69 73 74 2c 20 64 74 | 70 4c 69 73 74 3b 0d 09 |List, dt|pList;..|
|00001d70| 46 53 53 70 65 63 09 09 | 09 6d 79 46 53 53 2c 20 |FSSpec..|.myFSS, |
|00001d80| 64 74 70 46 53 53 3b 0d | 09 6c 6f 6e 67 09 09 09 |dtpFSS;.|.long...|
|00001d90| 69 74 65 6d 73 49 6e 4c | 69 73 74 2c 20 69 3b 0d |itemsInL|ist, i;.|
|00001da0| 09 41 45 4b 65 79 77 6f | 72 64 09 09 74 68 65 4b |.AEKeywo|rd..theK|
|00001db0| 65 79 77 6f 72 64 3b 0d | 09 44 65 73 63 54 79 70 |eyword;.|.DescTyp|
|00001dc0| 65 09 09 74 79 70 65 43 | 6f 64 65 3b 0d 09 42 6f |e..typeC|ode;..Bo|
|00001dd0| 6f 6c 65 61 6e 09 09 09 | 64 72 61 67 67 65 64 54 |olean...|draggedT|
|00001de0| 6f 44 54 50 20 3d 20 66 | 61 6c 73 65 3b 0d 09 53 |oDTP = f|alse;..S|
|00001df0| 69 7a 65 09 09 09 61 63 | 74 75 61 6c 53 69 7a 65 |ize...ac|tualSize|
|00001e00| 3b 0d 09 4d 79 44 6f 63 | 75 6d 65 6e 74 50 74 72 |;..MyDoc|umentPtr|
|00001e10| 09 6e 65 77 44 6f 63 75 | 6d 65 6e 74 3b 0d 0d 23 |.newDocu|ment;..#|
|00001e20| 70 72 61 67 6d 61 20 75 | 6e 75 73 65 64 20 28 72 |pragma u|nused (r|
|00001e30| 65 70 6c 79 2c 20 6d 79 | 52 65 66 43 6f 6e 29 0d |eply, my|RefCon).|
|00001e40| 0d 2f 2f 20 53 65 65 20 | 69 66 20 74 68 65 20 64 |.// See |if the d|
|00001e50| 6f 63 75 6d 65 6e 74 20 | 77 61 73 20 64 72 61 67 |ocument |was drag|
|00001e60| 67 65 64 20 74 6f 20 61 | 20 64 65 73 6b 74 6f 70 |ged to a| desktop|
|00001e70| 20 70 72 69 6e 74 65 72 | 2e 0d 0d 09 65 72 72 20 | printer|....err |
|00001e80| 3d 20 41 45 47 65 74 41 | 74 74 72 69 62 75 74 65 |= AEGetA|ttribute|
|00001e90| 44 65 73 63 28 74 68 65 | 41 70 70 6c 65 45 76 65 |Desc(the|AppleEve|
|00001ea0| 6e 74 2c 20 6b 65 79 4f | 70 74 69 6f 6e 61 6c 4b |nt, keyO|ptionalK|
|00001eb0| 65 79 77 6f 72 64 41 74 | 74 72 2c 20 74 79 70 65 |eywordAt|tr, type|
|00001ec0| 41 45 4c 69 73 74 2c 20 | 26 64 74 70 4c 69 73 74 |AEList, |&dtpList|
|00001ed0| 29 3b 0d 09 69 66 20 28 | 65 72 72 20 3d 3d 20 6e |);..if (|err == n|
|00001ee0| 6f 45 72 72 29 20 64 72 | 61 67 67 65 64 54 6f 44 |oErr) dr|aggedToD|
|00001ef0| 54 50 20 3d 20 74 72 75 | 65 3b 0d 0d 2f 2a 0d 09 |TP = tru|e;../*..|
|00001f00| 49 66 20 77 65 20 64 72 | 61 67 67 65 64 20 74 6f |If we dr|agged to|
|00001f10| 20 61 20 64 65 73 6b 74 | 6f 70 20 70 72 69 6e 74 | a deskt|op print|
|00001f20| 65 72 2c 20 67 65 74 20 | 74 68 65 20 6e 61 6d 65 |er, get |the name|
|00001f30| 0d 09 6f 66 20 74 68 65 | 20 64 65 73 6b 74 6f 70 |..of the| desktop|
|00001f40| 20 70 72 69 6e 74 65 72 | 20 61 6e 64 20 74 68 65 | printer| and the|
|00001f50| 6e 20 74 68 72 6f 77 20 | 61 77 61 79 20 74 68 65 |n throw |away the|
|00001f60| 0d 09 64 65 73 63 72 69 | 70 74 69 6f 6e 20 6c 69 |..descri|ption li|
|00001f70| 73 74 20 66 6f 72 20 69 | 74 2e 0d 2a 2f 0d 0d 09 |st for i|t..*/...|
|00001f80| 69 66 20 28 64 72 61 67 | 67 65 64 54 6f 44 54 50 |if (drag|gedToDTP|
|00001f90| 29 0d 09 7b 0d 09 09 65 | 72 72 20 3d 20 41 45 47 |)..{...e|rr = AEG|
|00001fa0| 65 74 4e 74 68 50 74 72 | 28 26 64 74 70 4c 69 73 |etNthPtr|(&dtpLis|
|00001fb0| 74 2c 20 31 2c 20 74 79 | 70 65 46 53 53 2c 20 26 |t, 1, ty|peFSS, &|
|00001fc0| 74 68 65 4b 65 79 77 6f | 72 64 2c 20 26 74 79 70 |theKeywo|rd, &typ|
|00001fd0| 65 43 6f 64 65 2c 0d 09 | 09 09 09 09 09 20 20 28 |eCode,..|..... (|
|00001fe0| 50 74 72 29 20 26 64 74 | 70 46 53 53 2c 20 73 69 |Ptr) &dt|pFSS, si|
|00001ff0| 7a 65 6f 66 28 46 53 53 | 70 65 63 29 2c 20 26 61 |zeof(FSS|pec), &a|
|00002000| 63 74 75 61 6c 53 69 7a | 65 29 3b 0d 09 0d 09 09 |ctualSiz|e);.....|
|00002010| 41 45 44 69 73 70 6f 73 | 65 44 65 73 63 28 26 64 |AEDispos|eDesc(&d|
|00002020| 74 70 4c 69 73 74 29 3b | 0d 09 7d 0d 0d 2f 2f 20 |tpList);|..}..// |
|00002030| 47 65 74 20 6f 75 72 20 | 64 6f 63 75 6d 65 6e 74 |Get our |document|
|00002040| 20 6c 69 73 74 2e 0d 0d | 09 65 72 72 20 3d 20 41 | list...|.err = A|
|00002050| 45 47 65 74 50 61 72 61 | 6d 44 65 73 63 28 74 68 |EGetPara|mDesc(th|
|00002060| 65 41 70 70 6c 65 45 76 | 65 6e 74 2c 20 6b 65 79 |eAppleEv|ent, key|
|00002070| 44 69 72 65 63 74 4f 62 | 6a 65 63 74 2c 20 74 79 |DirectOb|ject, ty|
|00002080| 70 65 41 45 4c 69 73 74 | 2c 20 26 64 6f 63 4c 69 |peAEList|, &docLi|
|00002090| 73 74 29 3b 0d 09 6e 72 | 65 71 75 69 72 65 28 65 |st);..nr|equire(e|
|000020a0| 72 72 2c 20 41 45 45 72 | 72 6f 72 29 3b 0d 0d 2f |rr, AEEr|ror);../|
|000020b0| 2a 0d 09 4d 61 6b 65 20 | 73 75 72 65 20 77 65 27 |*..Make |sure we'|
|000020c0| 76 65 20 61 63 63 6f 75 | 6e 74 65 64 20 66 6f 72 |ve accou|nted for|
|000020d0| 20 61 6c 6c 20 6f 66 20 | 74 68 65 20 70 61 72 61 | all of |the para|
|000020e0| 6d 65 74 65 72 73 0d 09 | 70 61 73 73 65 64 2c 20 |meters..|passed, |
|000020f0| 61 6e 64 20 63 6f 75 6e | 74 20 74 68 65 20 6e 75 |and coun|t the nu|
|00002100| 6d 62 65 72 20 6f 66 20 | 64 6f 63 75 6d 65 6e 74 |mber of |document|
|00002110| 73 20 70 61 73 73 65 64 | 20 69 6e 2e 0d 2a 2f 0d |s passed| in..*/.|
|00002120| 0d 09 65 72 72 20 3d 20 | 4d 79 43 68 65 63 6b 41 |..err = |MyCheckA|
|00002130| 45 50 61 72 61 6d 73 28 | 74 68 65 41 70 70 6c 65 |EParams(|theApple|
|00002140| 45 76 65 6e 74 29 3b 0d | 09 6e 72 65 71 75 69 72 |Event);.|.nrequir|
|00002150| 65 28 65 72 72 2c 20 41 | 45 45 72 72 6f 72 29 3b |e(err, A|EError);|
|00002160| 0d 09 0d 09 65 72 72 20 | 3d 20 41 45 43 6f 75 6e |....err |= AECoun|
|00002170| 74 49 74 65 6d 73 28 26 | 64 6f 63 4c 69 73 74 2c |tItems(&|docList,|
|00002180| 20 26 69 74 65 6d 73 49 | 6e 4c 69 73 74 29 3b 0d | &itemsI|nList);.|
|00002190| 09 6e 72 65 71 75 69 72 | 65 28 65 72 72 2c 20 41 |.nrequir|e(err, A|
|000021a0| 45 45 72 72 6f 72 29 3b | 0d 0d 2f 2a 0d 09 46 6f |EError);|../*..Fo|
|000021b0| 72 20 65 61 63 68 20 65 | 6e 74 72 79 20 69 6e 20 |r each e|ntry in |
|000021c0| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 6c 69 73 |the docu|ment lis|
|000021d0| 74 2c 20 6c 6f 61 64 20 | 69 74 2c 0d 09 70 72 69 |t, load |it,..pri|
|000021e0| 6e 74 20 69 74 2c 20 61 | 6e 64 20 63 6c 6f 73 65 |nt it, a|nd close|
|000021f0| 20 69 74 2e 0d 2a 2f 0d | 0d 09 66 6f 72 20 28 69 | it..*/.|..for (i|
|00002200| 20 3d 20 31 3b 20 69 3c | 3d 20 69 74 65 6d 73 49 | = 1; i<|= itemsI|
|00002210| 6e 4c 69 73 74 3b 20 69 | 2b 2b 29 0d 09 7b 0d 09 |nList; i|++)..{..|
|00002220| 09 65 72 72 20 3d 20 41 | 45 47 65 74 4e 74 68 50 |.err = A|EGetNthP|
|00002230| 74 72 28 26 64 6f 63 4c | 69 73 74 2c 20 69 2c 20 |tr(&docL|ist, i, |
|00002240| 74 79 70 65 46 53 53 2c | 20 26 74 68 65 4b 65 79 |typeFSS,| &theKey|
|00002250| 77 6f 72 64 2c 20 26 74 | 79 70 65 43 6f 64 65 2c |word, &t|ypeCode,|
|00002260| 0d 09 09 09 09 09 09 20 | 20 28 50 74 72 29 20 26 |....... | (Ptr) &|
|00002270| 6d 79 46 53 53 2c 20 73 | 69 7a 65 6f 66 28 46 53 |myFSS, s|izeof(FS|
|00002280| 53 70 65 63 29 2c 20 26 | 61 63 74 75 61 6c 53 69 |Spec), &|actualSi|
|00002290| 7a 65 29 3b 0d 0d 09 09 | 6e 72 65 71 75 69 72 65 |ze);....|nrequire|
|000022a0| 28 65 72 72 2c 20 41 45 | 45 6e 74 72 79 45 72 72 |(err, AE|EntryErr|
|000022b0| 6f 72 29 3b 0d 0d 2f 2f | 20 4c 6f 61 64 20 74 68 |or);..//| Load th|
|000022c0| 65 20 64 6f 63 75 6d 65 | 6e 74 2e 0d 0d 09 09 65 |e docume|nt.....e|
|000022d0| 72 72 20 3d 20 4d 79 43 | 72 65 61 74 65 44 6f 63 |rr = MyC|reateDoc|
|000022e0| 75 6d 65 6e 74 28 6b 44 | 65 66 61 75 6c 74 54 69 |ument(kD|efaultTi|
|000022f0| 74 6c 65 2c 20 26 6e 65 | 77 44 6f 63 75 6d 65 6e |tle, &ne|wDocumen|
|00002300| 74 29 3b 0d 09 09 6e 72 | 65 71 75 69 72 65 28 65 |t);...nr|equire(e|
|00002310| 72 72 2c 20 43 72 65 61 | 74 65 44 6f 63 46 61 69 |rr, Crea|teDocFai|
|00002320| 6c 65 64 29 3b 0d 0d 09 | 09 65 72 72 20 3d 20 4d |led);...|.err = M|
|00002330| 79 46 53 4c 6f 61 64 44 | 6f 63 75 6d 65 6e 74 28 |yFSLoadD|ocument(|
|00002340| 6e 65 77 44 6f 63 75 6d | 65 6e 74 2c 20 26 6d 79 |newDocum|ent, &my|
|00002350| 46 53 53 2c 20 74 72 75 | 65 29 3b 0d 09 09 6e 72 |FSS, tru|e);...nr|
|00002360| 65 71 75 69 72 65 28 65 | 72 72 2c 20 4c 6f 61 64 |equire(e|rr, Load|
|00002370| 44 6f 63 46 61 69 6c 65 | 64 29 3b 0d 0d 2f 2a 0d |DocFaile|d);../*.|
|00002380| 09 49 66 20 77 65 20 64 | 72 61 67 67 65 64 20 74 |.If we d|ragged t|
|00002390| 6f 20 61 20 64 65 73 6b | 74 6f 70 20 70 72 69 6e |o a desk|top prin|
|000023a0| 74 65 72 2c 20 73 65 6c | 65 63 74 20 74 68 61 74 |ter, sel|ect that|
|000023b0| 20 61 73 20 74 68 65 0d | 09 6f 75 74 70 75 74 20 | as the.|.output |
|000023c0| 70 72 69 6e 74 65 72 20 | 66 6f 72 20 65 61 63 68 |printer |for each|
|000023d0| 20 6a 6f 62 20 61 6e 64 | 20 64 6f 20 61 20 22 50 | job and| do a "P|
|000023e0| 72 69 6e 74 20 4f 6e 65 | 20 43 6f 70 79 2e 22 0d |rint One| Copy.".|
|000023f0| 09 4f 74 68 65 72 77 69 | 73 65 2c 20 77 65 27 72 |.Otherwi|se, we'r|
|00002400| 65 20 6a 75 73 74 20 64 | 6f 69 6e 67 20 61 20 22 |e just d|oing a "|
|00002410| 50 72 69 6e 74 22 20 66 | 72 6f 6d 20 74 68 65 20 |Print" f|rom the |
|00002420| 46 69 6e 64 65 72 2c 0d | 09 73 6f 20 70 72 69 6e |Finder,.|.so prin|
|00002430| 74 20 77 69 74 68 20 64 | 69 61 6c 6f 67 73 2e 0d |t with d|ialogs..|
|00002440| 2a 2f 0d 0d 09 09 69 66 | 20 28 64 72 61 67 67 65 |*/....if| (dragge|
|00002450| 64 54 6f 44 54 50 29 0d | 09 09 7b 0d 09 09 09 47 |dToDTP).|..{....G|
|00002460| 58 53 65 6c 65 63 74 4a | 6f 62 4f 75 74 70 75 74 |XSelectJ|obOutput|
|00002470| 50 72 69 6e 74 65 72 28 | 6e 65 77 44 6f 63 75 6d |Printer(|newDocum|
|00002480| 65 6e 74 2d 3e 64 6f 63 | 75 6d 65 6e 74 4a 6f 62 |ent->doc|umentJob|
|00002490| 2c 20 64 74 70 46 53 53 | 2e 6e 61 6d 65 29 3b 0d |, dtpFSS|.name);.|
|000024a0| 09 09 09 65 72 72 20 3d | 20 4d 79 50 72 69 6e 74 |...err =| MyPrint|
|000024b0| 4f 6e 65 43 6f 70 79 28 | 6e 65 77 44 6f 63 75 6d |OneCopy(|newDocum|
|000024c0| 65 6e 74 29 3b 0d 09 09 | 7d 0d 09 09 65 6c 73 65 |ent);...|}...else|
|000024d0| 0d 09 09 09 65 72 72 20 | 3d 20 4d 79 50 72 69 6e |....err |= MyPrin|
|000024e0| 74 44 6f 63 75 6d 65 6e | 74 28 6e 65 77 44 6f 63 |tDocumen|t(newDoc|
|000024f0| 75 6d 65 6e 74 29 3b 0d | 0d 2f 2f 20 43 6c 6f 73 |ument);.|.// Clos|
|00002500| 65 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 20 6f |e the do|cument o|
|00002510| 6e 63 65 20 69 74 27 73 | 20 70 72 69 6e 74 65 64 |nce it's| printed|
|00002520| 2e 0d 0d 4c 6f 61 64 44 | 6f 63 46 61 69 6c 65 64 |...LoadD|ocFailed|
|00002530| 3a 0d 09 09 4d 79 44 69 | 73 70 6f 73 65 44 6f 63 |:...MyDi|sposeDoc|
|00002540| 75 6d 65 6e 74 28 6e 65 | 77 44 6f 63 75 6d 65 6e |ument(ne|wDocumen|
|00002550| 74 29 3b 0d 09 7d 0d 0d | 2f 2f 20 57 68 65 6e 20 |t);..}..|// When |
|00002560| 77 65 27 72 65 20 61 6c | 6c 20 64 6f 6e 65 20 74 |we're al|l done t|
|00002570| 68 72 6f 77 20 61 77 61 | 79 20 74 68 65 20 64 65 |hrow awa|y the de|
|00002580| 73 63 72 69 70 74 69 6f | 6e 20 6c 69 73 74 73 20 |scriptio|n lists |
|00002590| 61 6e 64 20 72 65 74 75 | 72 6e 2e 0d 0d 43 72 65 |and retu|rn...Cre|
|000025a0| 61 74 65 44 6f 63 46 61 | 69 6c 65 64 3a 0d 41 45 |ateDocFa|iled:.AE|
|000025b0| 45 6e 74 72 79 45 72 72 | 6f 72 3a 0d 09 09 41 45 |EntryErr|or:...AE|
|000025c0| 44 69 73 70 6f 73 65 44 | 65 73 63 28 26 64 6f 63 |DisposeD|esc(&doc|
|000025d0| 4c 69 73 74 29 3b 0d 0d | 41 45 45 72 72 6f 72 3a |List);..|AEError:|
|000025e0| 0d 09 69 66 20 28 67 51 | 75 69 74 41 66 74 65 72 |..if (gQ|uitAfter|
|000025f0| 50 72 69 6e 74 69 6e 67 | 29 0d 09 09 67 51 75 69 |Printing|)...gQui|
|00002600| 74 74 69 6e 67 20 3d 20 | 74 72 75 65 3b 0d 0d 09 |tting = |true;...|
|00002610| 72 65 74 75 72 6e 20 65 | 72 72 3b 0d 7d 0d 0d 0d |return e|rr;.}...|
|00002620| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00002630| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002640| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002650| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 20 20 |********|*****. |
|00002660| 4d 79 43 68 65 63 6b 41 | 45 50 61 72 61 6d 73 20 |MyCheckA|EParams |
|00002670| 2d 20 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 69 |- This r|outine i|
|00002680| 73 20 75 73 65 64 20 74 | 6f 20 6d 61 6b 65 20 73 |s used t|o make s|
|00002690| 75 72 65 20 77 65 27 76 | 65 0d 20 20 72 65 63 65 |ure we'v|e. rece|
|000026a0| 69 76 65 64 20 61 6c 6c | 20 74 68 65 20 70 61 72 |ived all| the par|
|000026b0| 61 6d 65 74 65 72 73 20 | 66 6f 72 20 61 6e 20 41 |ameters |for an A|
|000026c0| 70 70 6c 65 45 76 65 6e | 74 2e 20 20 49 66 20 73 |ppleEven|t. If s|
|000026d0| 6f 2c 20 77 65 0d 20 20 | 72 65 74 75 72 6e 20 6e |o, we. |return n|
|000026e0| 6f 45 72 72 2c 20 6f 74 | 68 65 72 77 69 73 65 20 |oErr, ot|herwise |
|000026f0| 77 65 20 69 6e 64 69 63 | 61 74 65 20 74 68 61 74 |we indic|ate that|
|00002700| 20 74 68 65 20 65 76 65 | 6e 74 20 77 61 73 6e 27 | the eve|nt wasn'|
|00002710| 74 0d 20 20 68 61 6e 64 | 6c 65 64 20 63 6f 6d 70 |t. hand|led comp|
|00002720| 6c 65 74 65 6c 79 2e 0d | 20 0d 20 2a 2a 2a 2a 2a |letely..| . *****|
|00002730| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002740| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002760| 2a 2a 2a 2a 2a 2a 2a 2a | 2f 0d 0d 4f 53 45 72 72 |********|/..OSErr|
|00002770| 20 4d 79 43 68 65 63 6b | 41 45 50 61 72 61 6d 73 | MyCheck|AEParams|
|00002780| 28 41 70 70 6c 65 45 76 | 65 6e 74 20 2a 74 68 65 |(AppleEv|ent *the|
|00002790| 41 70 70 6c 65 45 76 65 | 6e 74 29 0d 7b 0d 09 4f |AppleEve|nt).{..O|
|000027a0| 53 45 72 72 09 09 65 72 | 72 3b 0d 09 44 65 73 63 |SErr..er|r;..Desc|
|000027b0| 54 79 70 65 09 74 79 70 | 65 43 6f 64 65 3b 0d 09 |Type.typ|eCode;..|
|000027c0| 53 69 7a 65 09 09 61 63 | 74 75 61 6c 53 69 7a 65 |Size..ac|tualSize|
|000027d0| 3b 0d 09 0d 09 65 72 72 | 20 3d 20 41 45 47 65 74 |;....err| = AEGet|
|000027e0| 41 74 74 72 69 62 75 74 | 65 50 74 72 28 74 68 65 |Attribut|ePtr(the|
|000027f0| 41 70 70 6c 65 45 76 65 | 6e 74 2c 20 6b 65 79 4d |AppleEve|nt, keyM|
|00002800| 69 73 73 65 64 4b 65 79 | 77 6f 72 64 41 74 74 72 |issedKey|wordAttr|
|00002810| 2c 0d 09 09 09 09 09 09 | 09 74 79 70 65 57 69 6c |,.......|.typeWil|
|00002820| 64 43 61 72 64 2c 20 26 | 74 79 70 65 43 6f 64 65 |dCard, &|typeCode|
|00002830| 2c 20 6e 69 6c 2c 20 30 | 2c 20 26 61 63 74 75 61 |, nil, 0|, &actua|
|00002840| 6c 53 69 7a 65 29 3b 0d | 0d 09 69 66 20 28 65 72 |lSize);.|..if (er|
|00002850| 72 20 3d 3d 20 65 72 72 | 41 45 44 65 73 63 4e 6f |r == err|AEDescNo|
|00002860| 74 46 6f 75 6e 64 29 20 | 72 65 74 75 72 6e 20 6e |tFound) |return n|
|00002870| 6f 45 72 72 3b 0d 09 69 | 66 20 28 65 72 72 20 3d |oErr;..i|f (err =|
|00002880| 3d 20 6e 6f 45 72 72 29 | 20 72 65 74 75 72 6e 20 |= noErr)| return |
|00002890| 65 72 72 41 45 45 76 65 | 6e 74 4e 6f 74 48 61 6e |errAEEve|ntNotHan|
|000028a0| 64 6c 65 64 3b 0d 09 0d | 09 72 65 74 75 72 6e 20 |dled;...|.return |
|000028b0| 65 72 72 3b 0d 7d 0d 00 | 00 00 00 00 00 00 00 00 |err;.}..|........|
|000028c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002900| 00 00 01 00 00 00 02 2a | 00 00 01 2a 00 00 00 66 |.......*|...*...f|
|00002910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002920| 00 00 00 00 00 00 00 15 | 00 00 00 18 00 00 00 24 |........|.......$|
|00002930| 08 65 76 65 6e 74 73 2e | 63 00 02 00 00 00 54 45 |.events.|c.....TE|
|00002940| 58 54 4b 41 48 4c 01 00 | 00 64 00 00 00 00 00 00 |XTKAHL..|.d......|
|00002950| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 64 00 00 |..TEXTKA|HL...d..|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002970| 00 00 a9 69 86 85 00 00 | 28 37 00 00 02 90 00 4a |...i....|(7.....J|
|00002980| 00 00 01 53 00 00 00 00 | 00 00 00 4b 00 00 00 4d |...S....|...K...M|
|00002990| 00 00 00 50 00 00 00 51 | 00 00 00 52 00 00 01 54 |...P...Q|...R...T|
|000029a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000029b0| 00 00 00 55 00 00 00 58 | 00 00 00 5b 00 00 00 5e |...U...X|...[...^|
|000029c0| 00 00 00 00 00 00 00 60 | 00 00 00 00 00 00 01 fe |.......`|........|
|000029d0| 00 00 00 64 00 00 01 ed | 00 00 00 00 00 00 00 68 |...d....|.......h|
|000029e0| 00 00 01 55 00 00 00 6b | 00 00 00 00 00 00 01 f5 |...U...k|........|
|000029f0| 00 00 00 72 00 00 00 73 | 00 00 01 ff 00 00 00 00 |...r...s|........|
|00002a00| 00 00 00 0a 00 00 23 16 | ff ff 00 00 00 00 00 00 |......#.|........|
|00002a10| 00 14 00 01 00 12 00 00 | 27 f2 01 a9 01 36 a5 54 |........|'....6.T|
|00002a20| 10 08 03 6b 65 79 00 00 | 00 b4 00 08 00 00 26 ac |...key..|......&.|
|00002a30| 00 00 26 bb 0f 4d 79 43 | 68 65 63 6b 41 45 50 61 |..&..MyC|heckAEPa|
|00002a40| 72 61 6d 73 00 00 0f 42 | 00 00 0f 54 13 4d 79 44 |rams...B|...T.MyD|
|00002a50| 6f 41 45 49 6e 73 74 61 | 6c 6c 61 74 69 6f 6e 00 |oAEInsta|llation.|
|00002a60| 00 00 04 8c 00 00 04 95 | 09 4d 79 44 6f 45 76 65 |........|.MyDoEve|
|00002a70| 6e 74 00 00 03 53 00 00 | 03 5e 0b 4d 79 45 76 65 |nt...S..|.^.MyEve|
|00002a80| 6e 74 4c 6f 6f 70 00 00 | 12 d4 00 00 12 e0 0d 4d |ntLoop..|.......M|
|00002a90| 79 48 61 6e 64 6c 65 4f | 41 50 50 00 00 00 16 22 |yHandleO|APP...."|
|00002aa0| 00 00 16 2e 0d 4d 79 48 | 61 6e 64 6c 65 4f 44 4f |.....MyH|andleODO|
|00002ab0| 43 00 00 00 1c 31 00 00 | 1c 3d 0d 4d 79 48 61 6e |C....1..|.=.MyHan|
|00002ac0| 64 6c 65 50 44 4f 43 00 | 00 00 14 8e 00 00 14 9a |dlePDOC.|........|
|00002ad0| 0d 4d 79 48 61 6e 64 6c | 65 51 55 49 54 00 00 00 |.MyHandl|eQUIT...|
|00002ae0| 00 48 00 09 4d 6f 6e 61 | 63 6f 00 00 00 00 00 00 |.H..Mona|co......|
|00002af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002b00| 00 00 00 00 00 03 00 04 | 00 57 00 04 01 dc 02 7c |........|.W.....||
|00002b10| 00 57 00 04 01 dc 02 7c | aa 77 c6 78 00 00 02 13 |.W.....||.w.x....|
|00002b20| 00 00 02 54 00 00 00 00 | 01 00 00 00 01 00 00 00 |...T....|........|
|00002b30| 02 2a 00 00 01 2a 00 00 | 00 66 00 b8 b8 b8 17 e0 |.*...*..|.f......|
|00002b40| 00 00 00 1c 00 66 00 02 | 42 4b 50 54 00 00 00 1a |.....f..|BKPT....|
|00002b50| 44 54 56 55 00 00 00 26 | 4d 50 53 52 00 01 00 32 |DTVU...&|MPSR...2|
|00002b60| 07 61 ff ff 00 00 00 00 | 00 00 00 00 00 af ff ff |.a......|........|
|00002b70| 00 00 00 0e 00 00 00 00 | 03 ef ff ff 00 00 00 26 |........|.......&|
|00002b80| 00 00 00 00 03 ed ff ff | 00 00 00 de 00 00 00 00 |........|........|
|00002b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+